package com.apes.enquiry.supplier.baturu.model;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.plugin.outbox.OutboxEvent;
import com.apes.framework.plugin.outbox.annotation.OutBoxExclude;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

@OutBoxExclude
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = BaturuPurshPriceLog.CONST_TABLE_NAME)
public class BaturuPurshPriceLog {
    public static final String CONST_TABLE_NAME = "baturu_pursh_price_log";

    @Id
    @Column(name = "id", length = 32)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "巴图鲁推送报价日志")
    @Comment("消息编号")
    private String id;

    @Lob
    @Basic(fetch = FetchType.LAZY)
    @Column(name = "payload", columnDefinition = "CLOB")
    @Comment("消息体")
    private String payload;

    @Column(name = "aggregate_id")
    @Comment("聚合根ID")
    private String aggregateId;
}
